<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@page import="java.net.URLEncoder"%>
<%@ taglib prefix="s" uri="/struts-tags"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>"/>
    
    <title>My JSP 'medicinelist.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/styles.css">
	<SCRIPT type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.7.1.js"></SCRIPT>
	<script>
	$(function(){
	   $("#keybt").click(function(){
	  
	     $("#medForm").attr("action","keywordquery.action");
	      $("#medForm").submit(function (){
	        return true;
	      
	      }
	      );
	 });
	});
	$(function() {  

           $("#keytx").keyup(function() {  
               $("#autodiv").attr("style", "display:block");  
                $.post("key.action", { "keyWord": $(this).val() }, function(data, status) {  
                   if (status = "success") {  
                        var items = data;  
                       $("#autoList").empty();  
                       for (var k = 0; k < items.length; k++) {  
                            var li = $("<li>" + items[k] + "</li>");  
                           $("#autoList").append(li);  
                       }  
                       $("#autoList li").click(function(e) {  
                           $("#keytx").val($(this).text());  
                            $("#autodiv").attr("style", "display:none");  
                       });  
                    }  
               });  
           });  
        });  
	
	</script>
	

  </head>
  
  <body>
    <div class="div1">
		<table width="100%" cellpadding="0" cellspacing="0" border="0"
			align="center">
			<tr>
				<td class="td_title1">
					.当前位置
					&gt;&gt; 药品信息管理
					&gt;&gt; 查看药品
				</td>
			</tr>
			<tr>
				<td bgcolor="#FFFFFF" height="50">
					<br>
      <table border="1" align="center" width="700" cellpadding="0" cellspacing="1" bgcolor="#036500" bordercolor="#FFFFF">
        <tr bgcolor="#FFFFFF">
          <td colspan="10" align="center">
          		<table border="0" width="100%">
          			<tr>
          				<td align="left">
          					<form id="medForm" action="">
          					          <b style="size: 2ex">模糊查找：</b><input name="keyWord" type="text" size="20" id="keytx"/>
          						<input type="submit" value="查找" id="keybt"/>
          					</form>
          					<div id="autodiv">  
                            <ul id="autoList">  
                            </ul>  
          					</div>
          				</td>
          			</tr>
          		</table>
          </td>
        </tr>
        <tr bgcolor="#FFFFFF" >
          <td class="tb_tl">序号</td>
          <td class="tb_tl">药品编号</td>
          <td class="tb_tl">药品名称</td>
          <td class="tb_tl">单价</td>
          <td class="tb_tl">厂商</td>
          <td class="tb_tl">出厂地址</td>
          <td class="tb_tl">主治</td>
          <td class="tb_tl">类别</td>
          <td class="tb_tl">采购日期</td>
          <td class="tb_tl">操作</td>
         
        </tr>
            
             <%int i =0; %>
           
               <s:iterator id="medicineinfo" value="medicineList" >
              
               <% i++; %>
	        		<tr bgcolor="#FFFFFF">
					 
	        			<td><%=i %><input type="hidden" value="medicineId"/></td>
	        			<td><s:property value="medicineCode"/></td>
	        			<td>
	        			<s:property value="medicineName"/>
	        			</td>
	        			
	        			<td>
	        			<s:property value="medicinePrice"/>
						</td>
	        			<td><s:property value="medicineFactory"/></td>
	        			<td><s:property value="medicineFactoryAddress"/></td>
	        			<td><s:property value="medicineDesc"/></td>
	        			<td>
	        			 <s:property value="medicineCategory.categoryDesc"/>
	        			</td>
	        			<td><s:property value="buyTime"/></td>
	        			
	        			<td><s:a href="editmedicine.action?queryid=%{#medicineinfo.medicineId}" style="color: black;text-decoration: none;">修改</s:a>
	        			&nbsp;&nbsp;&nbsp;<s:a href="getdetail.action?queryid=%{#medicineinfo.medicineId}" style="text-decoration: none;">查看</s:a>
	        			</td>
	        		</tr>
	        	</s:iterator>
	        	
	        	
       
	        		
	        	
	        	<tr bgcolor="#FFFFFF">
		        
		          <td colspan="10" align="right">
		          	<table border="0" width="100%">
		          		<tr>
		          			<td>
		          				
		          			</td>
		          			
		          			<td align="right">
			          			
		          			</td>
		          		</tr>
		          	</table>
			      </td>
			    </tr>
        	
      </table>
      <br>
      </td>
			</tr>
		</table>
	</div>
  </body>
</html>
